package a01demo1;

public class Test2 {
    public static void main(String[] args) {

        String regex1 = "\\w{4,16}";
        System.out.println("zhn".matches(regex1));

        System.out.println("-----------------");

        String regex2 = "[1-9]\\d{16}(\\d|X|x)";
        System.out.println("44030519900101001X".matches(regex2));
        System.out.println("44030519900101001y".matches(regex2));

        System.out.println("------------------");

        String regex3 = "[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|10|11|12)(0[1-9]|[1-2]\\d|30|31)\\d{3}[\\dXx]";
        System.out.println("44030519900101001X".matches(regex3));
        System.out.println("44030519900101001y".matches(regex3));
    }
}
